<?php
$this_dir = dirname(__FILE__) . '/';
require_once($this_dir . '../../../autoload.php');
class ProviderDbTest extends PHPUnit_Framework_TestCase
{
    private $o;

    public function setUp()
    {
        $this->o = new ProviderDb();
    }

    public function InsertRow()
    {
    }

    public function testInsertRows()
    {
        $data = array(
            array(
                'id' => '1',
                'is_free' => '0',
                'is_genuine' => '1',
                'is_direct_download' => '0',
                'name' => '优酷',
            ),
            array(
                'id' => '2',
                'is_free' => '1',
                'is_genuine' => '1',
                'is_direct_download' => '0',
                'name' => '优酷',
            ),
            array(
                'id' => '3',
                'is_free' => '1',
                'is_genuine' => '1',
                'is_direct_download' => '0',
                'name' => '搜狐视频',
            ),
            array(
                'id' => '4',
                'is_free' => '1',
                'is_genuine' => '1',
                'is_direct_download' => '0',
                'name' => '乐视',
            ),
            array(
                'id' => '5',
                'is_free' => '0',
                'is_genuine' => '1',
                'is_direct_download' => '0',
                'name' => '乐视',
            ),
        );
        $r = $this->o->insertRows($data);
        var_dump($r);
        $data = array(
            array(
                'id' => '6',
                'is_free' => '1',
                'is_direct_download' => '1',
                'name' => '迅雷快传',
            ),
            array(
                'id' => '7',
                'is_free' => '1',
                'is_direct_download' => '1',
                'name' => 'ed2k',
            ),
            array(
                'id' => '8',
                'is_free' => '1',
                'is_direct_download' => '1',
                'name' => 'BT',
            ),
            array(
                'id' => '9',
                'is_free' => '1',
                'is_direct_download' => '1',
                'name' => 'PT',
            ),
        );
        $r = $this->o->insertRows($data);
        var_dump($r);
        $this->assertEquals(true, $r);
    }
}
?>
